﻿using System;

namespace YArchitech.Temp
{
	public class HYDuctTerminal : HYTerminal, IHYXmlSerial
	{
		public HYDuctTerminal()
		{
			base.Name = "风口";
			this.m_Port = new HYDuctSpecification(HYShapeProfile.Rectangular, 800, 320);
		}

		public HYDuctSpecification Port
		{
			get
			{
				return this.m_Port;
			}
			set
			{
				this.m_Port = value;
			}
		}

		public int Width
		{
			get
			{
				return this.m_Port.Width;
			}
			set
			{
				this.m_Port.Width = value;
			}
		}

		public int Height
		{
			get
			{
				return this.m_Port.Height;
			}
			set
			{
				this.m_Port.Height = value;
			}
		}

		public int Diameter
		{
			get
			{
				return this.m_Port.Diameter;
			}
			set
			{
				this.m_Port.Diameter = value;
			}
		}

		public override void Cal(HYSystemOption option)
		{
			HYDuctSystemOption hyductSystemOption = option as HYDuctSystemOption;
			double val = (base.Resistance <= 0.0) ? (hyductSystemOption.TerminalLoss * option.ShockFix) : (base.Resistance * option.ShockFix);
			HYPipeline hostPipeline = this.GetHostPipeline();
			if (hostPipeline == null)
			{
				return;
			}
			hostPipeline.AddAttachedObject(this, base.Name, val, true, 0);
		}

		private HYDuctSpecification m_Port;
	}
}
